<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>仪表盘 - FinalCMS Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="${ctx}/css/bootstrap.min.css" />
<link rel="stylesheet" href="${ctx}/css/font-awesome.min.css" />
<link rel="stylesheet" href="${ctx}/css/jquery-ui.custom.min.css" />

<!--[if lte IE 9]>
<link rel="stylesheet" href="${ctx}/css/fc-part2.min.css" />
<![endif]-->
<link rel="stylesheet" href="${ctx}/css/fc-skins.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-rtl.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-fonts.css" />
<link rel="stylesheet" href="${ctx}/css/fc.min.css" />
<link rel="stylesheet" href="${ctx}/css/fc-custom.css" />
<!--[if lte IE 8]>
<script src="${ctx}/js/html5shiv.js"></script>
<script src="${ctx}/js/respond.min.js"></script>
<![endif]-->

<!--[if lte IE 9]>
 <link rel="stylesheet" href="${ctx}/css/fc-ie.min.css" />
<![endif]-->
<script type="text/javascript" src='${ctx}/js/jquery1.11.0.min.js'></script>
</head>

<body class="no-skin">
<?include("../../inc/menu.html",{current:"friendlink"}){}?>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
		try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
	</script>

	<ul class="breadcrumb">
		<li><i class="ace-icon fa fa-home home-icon"></i> <a
			href="${ctx}/admin/index">首页</a></li>
		<li class="active">查看文章</li>
	</ul>
	<div class="nav-search" id="nav-search">
		<form class="form-search">
			<span class="input-icon"> <input type="text"
				placeholder="Search ..." class="nav-search-input"
				id="nav-search-input" autocomplete="off" /> <i
				class="ace-icon fa fa-search nav-search-icon"></i>
			</span>
		</form>
	</div>
</div>

<div class="page-content">
	<?include("../../inc/function.html"){}?>
	<div class="page-header">
		<h1>友情链接
		<small><i class="ace-icon fa fa-angle-double-right"></i> 所有友链</small>
		</h1>
	</div>
	<div class="row">
		<? if(exist("page") && page != null){ ?>	
		<div class="table-container col-xs-12 table_page">
			<table id="content-table" class="table table-striped table-bordered table-hover table_page">
				<thead>
					<tr>
						<th class="center"></th>
						<th class="center">关键词</th>
						<th class="center">链接</th>
						<th class="center">logo</th>
						<th class="center">状态</th>
						<th class="center">操作</th>
					</tr>
				</thead>
				<tbody>
					<#fc:foreach data="${page.list!}" ; list,index>
						<tr>
							<td class="center">
							<label class="position-relative">
								<input type="checkbox" class="ace table_check" value="${list.id!}">
								<span class="lbl"></span>
							</label></td>
							<!-- <td class="center"><img class="friendlink_logo" src="${list.logo!}"/></td> -->
							<td class="center" id="keyword_${list.id!}">${list.keyword!}</td>
							<td class="center">${list.url!}</td>
							<td class="center">${list.logo!}</td>
							<td class="center">${@org.yi.fc.enums.CommonStatus.parseEnum(list.status!).getDesc()}</td>
							<td class="center">
								<div class="hidden-sm hidden-xs action-buttons">
									<a href="${ctx}/admin/friendlink/edit?id=${list.id!}" class="green edit-content">
										 <i class="ace-icon fa fa-pencil bigger-130" title="编辑"></i>
									</a> 
									<a href="${ctx}/admin/friendlink/ban?id=${list.id!}" id="ban" class="dark forbid-content forbid" data="${list.id!}"> 
										<?if(1 == list.status) {?>
										<i class="ace-icon fa fa-check-square-o bigger-130" title="启用"></i>
										<?} else {?>
										<i class="ace-icon fa fa-ban bigger-130" title="禁用"></i>
										<?}?>
									</a>
									<a href="${ctx}/admin/friendlink/delete?id=${list.id!}" class="red del-content delete"> 
										<i class="ace-icon fa fa-trash-o bigger-130" title="删除"></i>
									</a>
								</div>
							</td>
						</tr>
					</#fc:foreach>
				</tbody>
			</table>
			<#fc:pagination page="${page!}" formId="frm" func1="启用" func2="禁用" func3="删除" />
		</div>
		<? } ?>		
		</form>
	</div>
</div>
</div>

<?include("../../inc/footer.html"){}?>

<script type="text/javascript" src="${ctx}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${ctx}/js/fc-extra.min.js"></script>
<script type="text/javascript" src="${ctx}/js/fc.min.js"></script>
<script type="text/javascript" src="${ctx}/js/admin/util.js"></script>
<script type="text/javascript">

$(document).ready(function(){
	
	//启用
	$("#page_func1").click(function(){
		window.location.href="${ctx}/admin/friendlink/ban?id="+getIds()+"&action=1";
	});
	//禁用
	$("#page_func2").click(function(){
		window.location.href="${ctx}/admin/friendlink/ban?id="+getIds()+"&action=0";
	});
	//删除
	$("#page_func3").click(function(){
		window.location.href="${ctx}/admin/friendlink/delete?id="+getIds();
	});
	
	//全选或者全不选
	$("#all_check").on("click",function(){
		selectAll($(this).get(0).checked, $(".table_check").toArray());
	});
	
});
function getIds() {
	var _id = "";
	$(".table_check").each(function(){
		if($(this).is(':checked')) 	{
	    	_id = _id + "," + $(this).attr("value");
	   	}
	});
	return _id;
}
</script>
	
</body>
</html>
